#ifndef _NEWLITERAL_HPP
#define _NEWLITERAL_HPP

#include <string>
#include "Expression.hpp"
#include "Identifier.hpp"
#include "Token.hpp"

namespace ast {

	class NewLiteral : public Expression {
	public:
		NewLiteral(TOKEN token) {
			_token = token;
		}

		virtual void ExpressionNode() override {}


		virtual string tokenLiteral() override {
			return _token._literal;
		}

		virtual string String() override {
			string out;
			out.append(_token._literal);
			out.append(" " + _objectName->_value);
			out.append(";");
			return out;
		}

		virtual ~NewLiteral() {
			if (_objectName != nullptr) {
				delete _objectName;
			}
		}

	public:
		TOKEN _token;
		Identifier* _objectName{ nullptr };
	};
}

#endif // !_INDEXEXPRESSION_HPP
